def g(a):
    flaq=True
    while flaq:
        flaq=False
        for i in range(len(a)-1):
            if a[i]>a[i+1]:
                a[i],a[i+1]=a[i+1],a[i]
                flaq=True
    return a

from time import*

t1=time()
f1=open('m1_sorted.txt').readlines()
f1=list(map(int,f1))
print(*g(f1))
t2=time()
print('m1_sorted',round(t2-t1)*100,"milliseconds")

t1=time()
f2=open('m2_reverse.txt').readlines()
f2=list(map(int,f2))
print(*g(f2))
t2=time()
print('m2_reverse',round(t2-t1)*100,"milliseconds")

t1=time()
f3=open('m3_shuffle.txt').readlines()
f3=list(map(int,f3))
print(g(f3))
t2=time()
print('m3_suffle',round(t2-t1)*100,"milliseconds")

